package qianji

import (
    "log"
    // "github.com/gorilla/websocket"
    "xszGame/common/models"
)

// 全局房间管理器
// var roomManager = struct {
//     rooms map[string]*GameRoom // 房间ID -> 房间对象
//     sync.RWMutex
// }{rooms: make(map[string]*GameRoom)}

func Handle(ctx *client.GameContext) {
    
		log.Println("欢迎来到千机牌")
    // roomManager.Lock()
    // defer roomManager.Unlock()
    
    // // 自动分配房间
    // if ctx.Msg.RoomID == "" {
    //     ctx.Msg.RoomID = allocateRoom(ctx.PlayerID)
    // }
    
    // room := roomManager.rooms[ctx.Msg.RoomID]
    // if room == nil {
    //     room = &GameRoom{ID: ctx.Msg.RoomID}
    //     roomManager.rooms[room.ID] = room
    // }
    
    // room.Players[ctx.PlayerID] = ctx.Conn
    // broadcast(room, "PLAYER_JOINED", ctx.PlayerID)
}